function upOrder(order){
	var sorder = $('#dr'+order).attr('order');
	var id = $('#dr'+order).attr('rel');
	$.post(APP+'/Manage/upOrder/',{id:id},function(result){
		if(result == 1){
			setUpOrder(sorder);
			setUpOrder
		}else{
			Alert('网络异常，请稍后再试');
		}
	});
}
function downOrder(order){
	var sorder = $('#dr'+order).attr('order');
	var id = $('#dr'+order).attr('rel')
	$.post(APP+'/Manage/downOrder/',{id:id},function(result){
		if(result == 1){
			setDownOrder(sorder);
		}else{
			Alert('网络异常，请稍后再试');
		}
	});
}
function setFeature(id){
	$.post(APP+'/Manage/setFeature/',{id:id},function(result){
		if(result == 1){
			location.reload();
		}else{
			Alert('网络异常，请稍后再试');
		}
	});
}
function setUpOrder(order){
	order = parseInt(order);
	var current_id = $('#dr'+order).attr('rel');
	var current_order = order;
	
	//求出上以个id和order
	var up_order = current_order-1;
	var up_id   = $('#dr'+up_order).attr('rel');
	
	//order是当前操作的序号
		var d= new Array();
		d[up_order] = new Array();
		d[current_order] = new Array();
		
		d[up_order]['d']  = $('.d'+up_order).clone();
		d[up_order]['dr'] = $('#dr'+up_order).clone(); 
		
		d[current_order]['d']  = $('.d'+current_order).clone();
		d[current_order]['dr'] = $('#dr'+current_order).clone(); 
		
		$('.d'+up_order).html(d[current_order]['d'].html());
		$('.d'+current_order).html(d[up_order]['d'].html());
		
		//修改当前正在移动的向上的移动不可选
		$('#dr'+up_order).attr('rel',current_id);
		$('#dr'+current_order).attr('rel',up_id);
}

function setDownOrder(order){
	order = parseInt(order);
	var current_id = $('#dr'+order).attr('rel');
	var current_order = order;
	
	//求出上以个id和order
	var up_order = current_order+1;
	var up_id   = $('#dr'+up_order).attr('rel');
	
	//order是当前操作的序号
		var d= new Array();
		d[up_order] = new Array();
		d[current_order] = new Array();
		
		d[up_order]['d']  = $('.d'+up_order).clone();
		d[up_order]['dr'] = $('#dr'+up_order).clone(); 
		
		d[current_order]['d']  = $('.d'+current_order).clone();
		d[current_order]['dr'] = $('#dr'+current_order).clone(); 
		
		$('.d'+up_order).html(d[current_order]['d'].html());
		$('.d'+current_order).html(d[up_order]['d'].html());
		
		//修改当前正在移动的向上的移动不可选
		$('#dr'+up_order).attr('rel',current_id);
		$('#dr'+current_order).attr('rel',up_id);
}